<!-- 检验报告明细 -->
<template>
	<view class="wrapper">
		<view class="item-detail" v-for="item in dataList">
			<p>项目名称：{{item.ItemName}}</p>
			<p>项目编码：{{item.ItemCode}}</p>
			<p>组合项目：{{item.GroupName}}</p>
			<p>检验结果：{{item.ResVal}}</p>
			<p>参考范围：{{item.Reference}}</p>
			<p>结果单位：{{item.ResUnit}}</p>
		</view>
		
		<healthCardQueryComp
		  v-if="healthCardQueryVisible"
		  :env="env"
		  :hospitalId="hospitalId"
		  :channel="channel"
		  :openId="openId"
		  :scene="scene"
		  :healthCardId="healthCardId"
		  :pos="pos"
		></healthCardQueryComp>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				healthCardQueryVisible: false,
				dataList: [],
				env: 'prod',
				hospitalId: '37868',
				channel: '0402',
				openId: uni.getStorageSync('openid'),
				scene: '0101082',
				healthCardId: uni.getStorageSync('current_user_card').numcard,
				pos: 'top'
			}
		},
		onLoad(option) {
			this.api_detail(option.reportno)
			setTimeout(()=>{
				this.healthCardQueryVisible = true
			}, 2000)
		},
		methods: {
			api_detail(reportno) {
				this.dataList = []
				let openid = uni.getStorageSync('openid')
				let numcard = uni.getStorageSync('current_user_card').numcard
				this.$app._post_form2("apireport.examinereportdetail", {
					"applyno": "0",
					"combono": "0",
					"microbe": "0",
					"reportno": reportno,
					"openid": openid,
					"cardid": numcard
				}, (res) => {
					console.log(res.data)
					this.dataList = res.data
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.wrapper {
		width: 100%;
		height: 100%;
		padding: 15px;
		padding-top: 60px;
		box-sizing: border-box;
		.item-detail {
			border-radius: 6px;
			border: 1px solid #e3e3e3;
			padding: 10px;
			line-height: 30px;
			background-color: #f5f5f5;
			font-size: .9rem;
			color: #757575;
			margin-bottom: 5px;
		}
		
	}
</style>